Skip to content

[WIP] feat: Span Streaming POC#17852

Draft
Lms24 wants to merge 84 commits intodevelopfrom
lms/feat-span-streaming-poc
Draft

[WIP] feat: Span Streaming POC#17852
Lms24 wants to merge 84 commits intodevelopfrom
lms/feat-span-streaming-poc

Conversation

@Lms24
Copy link
Member

@Lms24 Lms24 commented Oct 2, 2025

This PR contains the POC span streaming implementation for browser SDKs.

Can be tested on @sentry/browser@10.21.0-alpha.1 and any higher-level SDKs.

To opt into span streaming, set:

Sentry.init({
  dsn: '...',
  tracesSampleRate: 1,
  traceLifecycle: 'stream', // <-- (not mandatory; integration is enough)
  integrations: [
    Sentry.browserTracingIntegration();
    Sentry.spanStreamingIntegration(); <-- 
  ],

  // if you use beforeSendSpan, you have to opt into the new serialized span format:
  beforeSendSpan: withStreamSpan(serializedSpan => {
     // do something
     return serializedSpan
   }),
})

Also note that spans will no longer be sent to any event processors added via one if the *.addEventProcessor APIs. If you have any event processors, consider using beforeSendSpan or ignoreSpans.

@Lms24 Lms24 changed the title feat: Span Streaming POC [WIP] feat: Span Streaming POC Oct 2, 2025
@Lms24 Lms24 self-assigned this Oct 2, 2025
@Lms24 Lms24 force-pushed the lms/feat-span-streaming-poc branch from 31db546 to 20590fe Compare October 2, 2025 14:59
@github-actions
Copy link
Contributor

github-actions bot commented Oct 2, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 26.54 kB +3.83% +978 B 🔺
@sentry/browser - with treeshaking flags 25.01 kB +3.88% +932 B 🔺
@sentry/browser (incl. Tracing) 43.8 kB +3.39% +1.44 kB 🔺
@sentry/browser (incl. Tracing, Profiling) 48.56 kB +3.25% +1.52 kB 🔺
@sentry/browser (incl. Tracing, Replay) 82.64 kB +1.81% +1.46 kB 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 72.19 kB +1.97% +1.39 kB 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 87.31 kB +1.69% +1.45 kB 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 99.49 kB +1.49% +1.46 kB 🔺
@sentry/browser (incl. Feedback) 43.24 kB +2.26% +952 B 🔺
@sentry/browser (incl. sendFeedback) 31.2 kB +3.2% +967 B 🔺
@sentry/browser (incl. FeedbackAsync) 36.17 kB +2.68% +942 B 🔺
@sentry/browser (incl. Metrics) 27.51 kB +2.88% +769 B 🔺
@sentry/browser (incl. Logs) 27.66 kB +2.91% +780 B 🔺
@sentry/browser (incl. Metrics & Logs) 28.32 kB +2.77% +761 B 🔺
@sentry/react 28.28 kB +3.47% +947 B 🔺
@sentry/react (incl. Tracing) 46.1 kB +3.09% +1.38 kB 🔺
@sentry/vue 31.24 kB +4.1% +1.23 kB 🔺
@sentry/vue (incl. Tracing) 45.64 kB +3.24% +1.43 kB 🔺
@sentry/svelte 26.56 kB +3.84% +981 B 🔺
CDN Bundle 28.85 kB +2.63% +738 B 🔺
CDN Bundle (incl. Tracing) 45.69 kB +5.77% +2.49 kB 🔺
CDN Bundle (incl. Logs, Metrics) 29.7 kB +2.59% +749 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 46.52 kB +5.66% +2.49 kB 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 68.81 kB +1.16% +788 B 🔺
CDN Bundle (incl. Tracing, Replay) 82.6 kB +3.16% +2.53 kB 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 83.48 kB +3.14% +2.54 kB 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 88.06 kB +3% +2.56 kB 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 88.92 kB +2.93% +2.52 kB 🔺
CDN Bundle - uncompressed 84.28 kB +2.51% +2.06 kB 🔺
CDN Bundle (incl. Tracing) - uncompressed 135.89 kB +6.23% +7.97 kB 🔺
⛔️ CDN Bundle (incl. Logs, Metrics) - uncompressed (max: null) 0 B removed removed
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 138.73 kB +6.1% +7.97 kB 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 210.85 kB +1.03% +2.14 kB 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 253 kB +3.35% +8.2 kB 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 255.82 kB +3.31% +8.2 kB 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 265.81 kB +3.19% +8.2 kB 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 268.62 kB +3.15% +8.2 kB 🔺
@sentry/nextjs (client) 48.53 kB +3.17% +1.49 kB 🔺
@sentry/sveltekit (client) 44.26 kB +3.39% +1.45 kB 🔺
@sentry/node-core 53 kB +1.63% +845 B 🔺
@sentry/node 169.37 kB +1.72% +2.86 kB 🔺
@sentry/node - without tracing 96.91 kB +3.16% +2.96 kB 🔺
@sentry/aws-serverless 112.15 kB +2.47% +2.69 kB 🔺

View base workflow run

@github-actions
Copy link
Contributor

github-actions bot commented Oct 2, 2025

node-overhead report 🧳

Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.

Scenario Requests/s % of Baseline Prev. Requests/s Change %
GET Baseline 8,580 - 8,750 -2%
GET With Sentry 1,214 14% 1,591 -24%
GET With Sentry (error only) 5,804 68% 5,956 -3%
POST Baseline 1,152 - 1,155 -0%
POST With Sentry 477 41% 571 -16%
POST With Sentry (error only) 985 86% 1,036 -5%
MYSQL Baseline 3,159 - 3,207 -1%
MYSQL With Sentry 364 12% 463 -21%
MYSQL With Sentry (error only) 2,543 81% 2,577 -1%

View base workflow run

@Lms24 Lms24 force-pushed the lms/feat-span-streaming-poc branch 2 times, most recently from 84ec3fe to 4c1a555 Compare October 15, 2025 14:50
@Lms24 Lms24 force-pushed the lms/feat-span-streaming-poc branch from dc5f6de to a2aec25 Compare October 16, 2025 12:06
@Lms24 Lms24 force-pushed the lms/feat-span-streaming-poc branch from 7bb62f4 to fd533f3 Compare October 31, 2025 09:02
@Lms24 Lms24 force-pushed the lms/feat-span-streaming-poc branch 2 times, most recently from a35edc7 to 2d9b938 Compare November 12, 2025 10:58
@Lms24 Lms24 force-pushed the lms/feat-span-streaming-poc branch from e8e3944 to 2049208 Compare November 12, 2025 16:21
@Lms24 Lms24 force-pushed the lms/feat-span-streaming-poc branch from 2049208 to 860265a Compare November 19, 2025 16:43
@Lms24 Lms24 force-pushed the lms/feat-span-streaming-poc branch from 860265a to 41c93ff Compare November 21, 2025 14:34
@Lms24 Lms24 force-pushed the lms/feat-span-streaming-poc branch 2 times, most recently from 23c46cd to 25b73c6 Compare November 25, 2025 12:53
@Lms24 Lms24 force-pushed the lms/feat-span-streaming-poc branch from 66b37be to 282eed0 Compare December 11, 2025 14:34
@Lms24 Lms24 force-pushed the lms/feat-span-streaming-poc branch 3 times, most recently from 50208b8 to 780b812 Compare December 18, 2025 08:50
@Lms24 Lms24 force-pushed the lms/feat-span-streaming-poc branch from 2a75393 to 96f57a4 Compare January 9, 2026 13:12
@Lms24
Copy link
Member Author

Lms24 commented Jan 15, 2026

For my own recollection:

  • branch lms/tmp-custom-tracer has a semi-working implementation for filtering spans via ignoreSpans on span start

@Lms24 Lms24 force-pushed the lms/feat-span-streaming-poc branch from 30d746d to 27b145d Compare January 19, 2026 09:02
@Lms24 Lms24 force-pushed the lms/feat-span-streaming-poc branch from f528c45 to 577e487 Compare January 30, 2026 08:43
@Lms24 Lms24 force-pushed the lms/feat-span-streaming-poc branch from 7aa8018 to c7a3465 Compare February 13, 2026 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants